Skip to content

Conversation

@ronaldbarendse
Copy link
Contributor

Besides the preparations done in #20715 to support member type containers, I encountered an issue in 17.0.0-rc2 while trying to add initial support in Deploy.

Within Deploy, notification handlers are registered for all entity container operations (e.g. EntityContainerSavedNotification) to ensure schema/UDA files and signatures are updated. However, this caused the following exception:

NotSupportedException: Contained object type 9b5416fb-e72f-45a9-a07b-5a9a2709ce43 is not supported.
   at Umbraco.Cms.Infrastructure.Scoping.Scope.TryFinally(Action[] actions)
   at Umbraco.Cms.Infrastructure.Scoping.Scope.Dispose()
   at Umbraco.Cms.Core.Services.EntityTypeContainerService`2.SaveAsync(EntityContainer container, Guid userKey, Func`1 operationValidation, AuditType auditType)
   at Umbraco.Cms.Core.Services.EntityTypeContainerService`2.SaveAsync(EntityContainer container, Guid userKey, Func`1 operationValidation, AuditType auditType)
   at Umbraco.Cms.Core.Services.EntityTypeContainerService`2.CreateAsync(Nullable`1 key, String name, Nullable`1 parentKey, Guid userKey)
   at Umbraco.Cms.Api.Management.Controllers.FolderManagementControllerBase`1.CreateFolderAsync[TCreatedActionController](CreateFolderRequestModel createFolderRequestModel, Expression`1 createdAction)
   at Umbraco.Cms.Api.Management.Controllers.MemberType.Folder.CreateMemberTypeFolderController.Create(CancellationToken cancellationToken, CreateFolderRequestModel createFolderRequestModel)
...

Although not obvious from the stack trace, searching for the error message highlighted the EntityContainer.GetUdi() extension method not yet updated to support this new object type. And Deploy uses UDIs when updating the schema/signatures, so it makes sense that this only occurred when its installed.

Besides adding the missing member type, I've ordered them alphabetically now and updated the test to ensure the correct UDI is returned.

Copy link
Contributor

@AndyButland AndyButland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks @ronaldbarendse. This will come in 17.0-rc3.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a NotSupportedException that occurred when using Umbraco Deploy with member type containers by adding missing support for member type containers in the EntityContainer.GetUdi() extension method. The changes also improve code organization by alphabetizing the container type entries.

Key changes:

  • Added MemberType container support to GetUdi() extension method
  • Alphabetized container type entries across all affected files for better maintainability
  • Fixed incorrect null comparison for Guid value type in GetContainedObjectType()

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/Umbraco.Core/Extensions/UdiGetterExtensions.cs Added MemberType container case and reordered cases alphabetically
src/Umbraco.Core/Models/EntityContainer.cs Alphabetized ObjectTypeMap entries and fixed null comparison bug for Guid
tests/Umbraco.Tests.UnitTests/Umbraco.Core/Extensions/UdiGetterExtensionsTests.cs Added test case for MemberType container and reordered test cases alphabetically

@AndyButland AndyButland merged commit 0600df4 into release/17.0 Nov 14, 2025
28 of 29 checks passed
@AndyButland AndyButland deleted the v17/hotfix/entitycontainer-getudi branch November 14, 2025 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants